//package com.example.soapclient.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.oxm.jaxb.Jaxb2Marshaller;
//import org.springframework.ws.client.core.WebServiceTemplate;
//
//
//@Configuration
//public class SoapClientConfig {
//
//    @Bean
//    public Jaxb2Marshaller marshaller() {
//        Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
//        marshaller.setContextPath("com.example.soapclient.model");
//        return marshaller;
//    }
//
//    @Bean
//    public WebServiceTemplate webServiceTemplate(Jaxb2Marshaller marshaller) {
//        WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
//        webServiceTemplate.setMarshaller(marshaller);
//        webServiceTemplate.setUnmarshaller(marshaller);
//        webServiceTemplate.setDefaultUri("http://localhost:8080/soap-server/ws");
//
//        // 如果需要安全拦截器，可以取消注释下面的代码
//        // webServiceTemplate.setInterceptors(new ClientInterceptor[]{securityInterceptor()});
//
//        return webServiceTemplate;
//    }
//
//    // 安全拦截器示例（可选）
////    @Bean
////    public Wss4jSecurityInterceptor securityInterceptor() {
////        Wss4jSecurityInterceptor securityInterceptor = new Wss4jSecurityInterceptor();
////        // 配置安全策略
////        securityInterceptor.setSecurementActions("UsernameToken");
////        securityInterceptor.setSecurementUsername("admin");
////        securityInterceptor.setSecurementPassword("secret");
////        return securityInterceptor;
////    }
//}